package com.tool.btn;

import com.tool.PanelDisplay.RolePanelShow;
import com.tool.image.ImageMixDeal;
import com.tool.role.RoleData;
import com.tool.role.RoleProperty;
import com.tool.tcpimg.UIUtils;
import come.tool.Fighting.FightingMixDeal;
import come.tool.handle.HandleState;
import org.come.Frame.*;
import org.come.Jpanel.*;
import org.come.bean.LoginResult;
import org.come.bean.RoleAttribute;
import org.come.bean.RoleShow;
import org.come.entity.Goodstable;
import org.come.mouslisten.PetAddPointMouslisten;
import org.come.socket.Agreement;
import org.come.socket.SendMessageUntil;
import org.come.until.*;
import org.skill.frame.SkillMainFrame;
import org.wing.panel.WingMainFrame;

import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.math.BigDecimal;

public class ShaoXiangBtn extends MoBanBtn {
    private int BtnId;
    private ShaoXiangJpanel shaoXiangJpanel;

    public ShaoXiangBtn(String iconpath, int type, Color[] colors, int BtnId, String labelName,
                        ShaoXiangJpanel shaoXiangJpanel) {
        super(iconpath, type, colors);
        this.BtnId = BtnId;
        this.shaoXiangJpanel = shaoXiangJpanel;
        this.setText(labelName);
        if (BtnId == 0) {
            setFont(UIUtils.TEXT_FONT);
        } else {
            setFont(UIUtils.TEXT_HY88);
        }
        setVerticalTextPosition(SwingConstants.CENTER);
        setHorizontalTextPosition(SwingConstants.CENTER);
    }

    @Override
    public void chooseyes() {

    }

    @Override
    public void chooseno() {

    }

    @Override
    public void nochoose(MouseEvent e) {
        switch (BtnId) {
        case 0:
            break;
        case 1:
            Goodstable goodstable = UserMessUntil.getgoodstable(new BigDecimal(90002));
            int xianghuoNum =  GoodsListFromServerUntil.getGoodNum(goodstable.getGoodsid());
            if (xianghuoNum > 0) {
                if (shaoXiangJpanel.getBtnmount().isEnabled()) {
                    new BarProgress(shaoXiangJpanel.getjProgressBar(), shaoXiangJpanel.getBtnmount(), shaoXiangJpanel).start();
                }
            }else{
                ZhuFrame.getZhuJpanel().addPrompt2("没有香火，怎么供奉!#54");
            }
            break;
        case 2:
            break;
        default:
            break;
        }
    }
}
